import request from "../utils/request";

export function addProject(data) {
  return request({
    url: "/project/add",
    method: "POST",
    data
  });
}

export function editProjectNameById(data) {
  return request({
    url: "/project/edit",
    method: "PUT",
    data
  });
}

export function getProjectList(params) {
  return request({
    url: "/project/list",
    method: "get",
    params
  });
}

export function deleteProject(data) {
  return request({
    url: "/project/del",
    method: "delete",
    data
  });
}

export function copyProject(data) {
  return request({
    url: "/project/copy",
    method: "post",
    data
  });
}

export function getPageInfoByProjectId(params) {
  return request({
    url: "/page/listByProjectId",
    method: "get",
    params
  });
}

export function deletePage(data) {
  return request({
    url: "/page/del",
    method: "delete",
    data
  });
}

export function editPage(data) {
  return request({
    url: "/page/edit",
    method: "put",
    data
  });
}

export function addPage(data) {
  return request({
    url: "/page/add",
    method: "post",
    data
  });
}

export function publishPage(data) {
  return request({
    url: "/page/publish",
    method: "post",
    data
  });
}

export function getComponentTypeList(params) {
  return request({
    url: "/componentLib/list",
    method: "get",
    params
  });
}

export function getComponentsByType(params) {
  return request({
    url: "/componentLib/detail",
    method: "get",
    params
  });
}